package com.huidao.domain;
//鑿滃搧琛�

public class Food implements Comparable<Food>{
	private String foodId;
	private String foodName;
	private FoodCategory category;
	private double foodPrice;
	private double vipPrice;

	public Food() {
		super();
	}
	

	public Food(String foodId, String foodName, double foodPrice) {
		super();
		this.foodId = foodId;
		this.foodName = foodName;
		this.foodPrice = foodPrice;
	}


	public Food(String foodId, String foodName, FoodCategory category,
			double foodPrice, double vipPrice) {
		super();
		this.foodId = foodId;
		this.foodName = foodName;
		this.category = category;
		this.foodPrice = foodPrice;
		this.vipPrice = vipPrice;
	}

	public String getFoodId() {
		return foodId;
	}

	public void setFoodId(String foodId) {
		this.foodId = foodId;
	}

	public String getFoodName() {
		return foodName;
	}

	public void setFoodName(String foodName) {
		this.foodName = foodName;
	}

	public FoodCategory getCategory() {
		return category;
	}

	public void setCategory(FoodCategory category) {
		this.category = category;
	}

	public double getFoodPrice() {
		return foodPrice;
	}

	public void setFoodPrice(double foodPrice) {
		this.foodPrice = foodPrice;
	}

	public double getVipPrice() {
		return vipPrice;
	}

	public void setVipPrice(double vipPrice) {
		this.vipPrice = vipPrice;
	}

	@Override
	public String toString() {
		return foodId + "=" + foodName
				+ "=" + category + "=" + foodPrice
				+ "=" + vipPrice ;
	}
	
	
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((category == null) ? 0 : category.hashCode());
		result = prime * result + ((foodId == null) ? 0 : foodId.hashCode());
		result = prime * result
				+ ((foodName == null) ? 0 : foodName.hashCode());
		long temp;
		temp = Double.doubleToLongBits(foodPrice);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(vipPrice);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Food other = (Food) obj;
		if (category == null) {
			if (other.category != null)
				return false;
		} else if (!category.equals(other.category))
			return false;
		if (foodId == null) {
			if (other.foodId != null)
				return false;
		} else if (!foodId.equals(other.foodId))
			return false;
		if (foodName == null) {
			if (other.foodName != null)
				return false;
		} else if (!foodName.equals(other.foodName))
			return false;
		if (Double.doubleToLongBits(foodPrice) != Double
				.doubleToLongBits(other.foodPrice))
			return false;
		if (Double.doubleToLongBits(vipPrice) != Double
				.doubleToLongBits(other.vipPrice))
			return false;
		return true;
	}
	
	@Override
	public int compareTo(Food food) {	
		return 1;
	}
	
}
